<h1 class="page-title">新增司机</h1>
<div class="well" ng-controller="DriverNewController as vm">
  <form class="form-horizontal" ng-submit="vm.processForm()">
    <fieldset>
      <div class="span6">
        <div class="control-group" ng-show="vm.userRole=='admin'">
        <label class="control-label">*选择个人会员</label>
        <div class="controls">
            <select class="input-large" ng-model="formData.carrierId" ng-options="o.id as o.selectObj for o in carriers">
              <option value="">-- 请选择 --</option>
            </select>
            <p class="help-block"></p>
          </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label">*姓名</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="formData.name" >
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label">*手机号</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="formData.phoneNumber">
          <p class="help-block"></p>
        </div>
      </div>
      
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label">*身份证</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large" ng-model="formData.idNumber">
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">*上传驾驶证照片</label>
        <!-- File Upload -->
        <div class="controls">
            <input type="text" id="jia" placeholder="" class="input-large" style="display: none"/>
            <image id="jiaImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('jia')">上传文件</a>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label">*上传身份证照片</label>
        <!-- File Upload -->
        <div class="controls">
            <input type="text" id="shen" placeholder="" class="input-large" style="display: none"/>
            <image id="shenImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('shen')">上传文件</a>
        </div>
      </div>
    </div>
    <div class="span6">
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label">*驾驶证初次时间</label>
        <div class="controls">
            <input id="firstLicenseDate" placeholder="请输入日期" class="laydate-icon" onclick="laydate()">
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label">*驾驶证有效期</label>
        <div class="controls">
            <input id="licenseValidTo" placeholder="请输入日期" class="laydate-icon" onclick="laydate()">
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label">备用1</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large">
          <p class="help-block"></p>
        </div>
      </div>
      <div class="control-group">
        <!-- Text input-->
        <label class="control-label">备用2</label>
        <div class="controls">
          <input type="text" placeholder="" class="input-large">
          <p class="help-block"></p>
        </div>
      </div>
      
      
      
    </div>
    </fieldset>
    <br/>
    <div class="control-group">
        <label class="control-label"></label>
        <!-- Button -->
        <div class="controls">
          <button class="btn btn-primary" ng-disabled="uploadingLic || uploadingFile">新增</button>
        </div>
      </div>
  </form>
    <script>
        function openUpload(inputid){
            var url = "../views/upload.html?id="+ inputid;
            var iWidth=400; //弹出窗口的宽度;
            var iHeight=300; //弹出窗口的高度;
            var iTop = (window.screen.availHeight-30-iHeight)/2; //获得窗口的垂直位置;
            var iLeft = (window.screen.availWidth-10-iWidth)/2; //获得窗口的水平位置;
            window.open(url,'uploadwindow','height='+iHeight+',width='+iWidth+',top='+iTop+',left='+ iLeft +',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
        }
    </script>
</div>
